package controller.room
{
	import events.room.EventCreateNewRoom;
	
	import model.ModelProject;
	import model.ModelRooms;
	
	import org.flashIso.engine.base.IsoRoom;
	import org.robotlegs.mvcs.Command;
	
	public class CommandCreateNewRoom extends Command
	{
		[Inject]
		public var event:EventCreateNewRoom;
		
		[Inject]
		public var mp:ModelProject;
		
		[Inject]
		public var mr:ModelRooms;
		
		override public function execute() : void {
			mp.projectModified = true;

			var room:IsoRoom = new IsoRoom();
			room.id = mp.newItemName;
			mr.addRoom(room);
		}
	}
}